#include "vlog/logformatter.h"
#include "vlog/logger.h"
#include "vlog/util.h"
#include <chrono>
#include <ctime>
#include <iomanip>
#include <sstream>

#include <iostream>

int main(void)
{
    auto now = std::chrono::system_clock::now();
    std::time_t now_c = std::chrono::system_clock::to_time_t(now);
    std::tm local_tm = *std::localtime(&now_c);
    std::string tformatter{"%Y-%m-%d %H:%M:%S"};
    std::stringstream ss;
    std::cout << std::put_time(&local_tm, tformatter.c_str()) << std::endl;

    std::shared_ptr<vlog::Logger> pLogger = std::make_shared<vlog::Logger>();
    vlog::event::LogEvent::ptr pEvent(
        new vlog::event::LogEvent(__FILE__, vlog::LogLevel::Level::DEBUG, __LINE__, vlog::util::GetTimeMs(),
                                  vlog::util::GetTimeMs(), vlog::util::GetThreadID(), "thread_1", __func__, "test"));
    vlog::LogFormatter formatter("%d{%Y-%m-%d %H:%M:%S} %T%t%T%N%T[%p]%T[%c]%T%f:%l%T%m%n");

    std::cout << formatter.Formatter(pEvent);

    return 0;
}